home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19970326-19970626 / 000329_news@newsmaster….columbia.edu _Fri Jun 20 01:21:38 1997.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id BAA28994
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Fri, 20 Jun 1997 01:21:38 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id BAA21524
  7.     for kermit.misc@watsun; Fri, 20 Jun 1997 01:21:37 -0400 (EDT)
  8. Path: news.columbia.edu!panix!news.mathworks.com!news.maxwell.syr.edu!feed.nntp.acc.ca!newsfeeder.toronto.ican.net!news.rochester.ican.net!not-for-mail
  9. From: vefatica@syr.edu (Vincent Fatica)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: ShellExecute()
  12. Date: Fri, 20 Jun 1997 05:01:46 GMT
  13. Organization: Syracuse University Mathematics
  14. Lines: 47
  15. Message-ID: <33a9fbb4.471671067@news.rochester.ican.net>
  16. Reply-To: vefatica@syr.edu
  17. NNTP-Posting-Host: ppp-048.syracuse-01.ican.net
  18. Mime-Version: 1.0
  19. Content-Type: text/plain; charset=us-ascii
  20. Content-Transfer-Encoding: 7bit
  21. X-Newsreader: Forte Agent 1.01/32.397
  22. Xref: news.columbia.edu comp.protocols.kermit.misc:7191
  23.  
  24. OK ... so I built this useful little one-liner (on NT 4.0 with
  25. MSVC++4.0) ...
  26.  
  27. //SE.CPP
  28. #include <windows.h>
  29. HINSTANCE main ( int argc, char * argv[] )
  30. {return ShellExecute(NULL, "open", argv[1], 
  31.     (argc > 2) ? argv[2] : NULL, 
  32.     (argc > 3) ? argv[3] : NULL, 
  33.     SW_SHOW);
  34. }
  35.  
  36. syntax:  SE [shell_object] [parameters [working dir]]  
  37.  
  38. (Empty and multiword "parameters" must be "quoted"; likewise
  39. path\program names containing spaces.)
  40.  
  41. It can be used as K95's browser (tried it). Also, if you invoke SE
  42. from the K95 command line (with "run"), since SE itself exits, you can
  43. return to the K95 prompt while the browser (or whatever) is still
  44. running. It works here (on NT); no promises intended.
  45.  
  46. Command line examples:
  47.  
  48.     se http://www.kermit.columbia    (netscape, (here))
  49.     se c:                (explorer)
  50.     se c:\winnt            (explorer)
  51.     se CMD "" c:\winnt        (CMD session)
  52.     se CMD "/c file.bat"        (run bat & quit)
  53.     se mailto:vefatica@syr.edu    (pmail, (here))
  54.     se file.txt            (notepad)
  55.     se file.doc            (word, (here))
  56.     se ftp://kermit.columbia.edu    (netscape)
  57.     se CMD "/k dir /s /p" h:\k95\    (run dir & stay)
  58.     se     (starts explorer in root/boot dir (here anyway))
  59.  
  60. SE should start anything the shell knows how to handle, otherwise,
  61. fail and return 0. Anyone is welcomed to it. Get it (15872 bytes) at:
  62.  
  63.     ftp://math.syr.edu/pub/vefatica/se.exe
  64.  
  65.  - Vince
  66. ___
  67.    Vincent Fatica
  68.    Syracuse University Mathematics
  69.    vefatica@syr.edu
  70.    http://barnyard.syr.edu/~vefatica/